package com.ys.fmms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ys.fmms.mapper.LongitudinalWaveMapper;
import com.ys.fmms.pojo.LongitudinalWave;
import com.ys.fmms.service.LongitudinalWaveService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service(value = "longitudinalWaveServiceImpl")
public class LongitudinalWaveServiceImpl extends ServiceImpl<LongitudinalWaveMapper, LongitudinalWave> implements LongitudinalWaveService {
    @Override
    public LongitudinalWave getLast() {
        QueryWrapper<LongitudinalWave> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("create_time");
        wrapper.last("limit 1");
        return baseMapper.selectOne(wrapper);
    }
}
